I have a script that creates a metric called PercentPass (a real), and I want to pass the value of PercentPass into a cell in a table (object 1150) and truncate it to 4 significant figures with percent sign (xx.xx%). Can anyone show me how to accomplish this? |
Re: how to pass data from DXL script to object text. real PercentPass = 12.3456789 int PercentPassInt = intOf(PercentPass) int PercentPassDec = (intOf(PercentPass*100.0)) - (PercentPassInt *100) print(PercentPassInt "." PercentPassDec "%")
|
Re: how to pass data from DXL script to object text. SystemAdmin - Mon Apr 02 05:33:04 EDT 2012 real PercentPass = 12.3456789 int PercentPassInt = intOf(PercentPass) int PercentPassDec = (intOf(PercentPass*100.0)) - (PercentPassInt *100) print(PercentPassInt "." PercentPassDec "%")
But how, exactly, do I set the Object Text of Object 1150? Thanks again, Jim P.S. can anyone point me towards a more accessible text than the IBM/Rational/Telelogic DXL Reference Manual? Something like a "DXL for Dummies" or an O'Reilly "DXL in a Nutshell"? |
Re: how to pass data from DXL script to object text. Shieldslinger - Mon Apr 02 10:51:13 EDT 2012
void setPercentPass(real PercentPass, Module mRef, int AbsNo) {
if(null(mRef)) {
return()
}
int PercentPassInt = intOf(PercentPass)
int PercentPassDec = (intOf(PercentPass*100.0)) - (PercentPassInt *100)
// Note: this wont find Filtered objects
Object oRef = object(AbsNo, mRef)
if(!null(oRef)) {
oRef."Object Text" = PercentPassInt "." PercentPassDec "%"
}
}
Module m = current()
setPercentPass(12.3456789, m, 1150)
|